package com.yukh.framework.mybatis;

import java.util.Properties;

import javax.sql.DataSource;

import org.apache.ibatis.datasource.DataSourceFactory;
import org.logicalcobwebs.proxool.ProxoolDataSource;

public class MyBatisProlxoolDataSource implements DataSourceFactory{
	public ProxoolDataSource dataSource;
	
	public MyBatisProlxoolDataSource(){
		this.dataSource = new ProxoolDataSource();
	}
	
	@Override
	public DataSource getDataSource() {
		return dataSource;
	}

	@Override
	public void setProperties(Properties props) {
		dataSource.setDriver(props.getProperty("driver"));
		dataSource.setDriverUrl(props.getProperty("driverUrl"));
		dataSource.setUser(props.getProperty("user"));
		dataSource.setPassword(props.getProperty("password"));
	}
}
